<template>
	<view class="task-wrap">
		<!-- 仪器管理员 扫一扫 -->
		<view v-if="sweep">
			<u-navbar :is-back="false" title="扫一扫"></u-navbar>
			<sweep></sweep>
		</view>
		<!-- 采样员/采样组长 扫一扫 -->
		<view v-if="sweepKs">
			<u-navbar :is-back="false" title="扫一扫"></u-navbar>
			<sweepKs></sweepKs>
		</view>
		<!-- 扫码样品一维码 -->
		<view v-if="scanCode">
			<u-navbar :is-back="false" title="扫码样品一维码"></u-navbar>
			<scanCode></scanCode>
		</view>
		<tabBar></tabBar>
	</view>

</template>

<script>
	import sweep from './sweep/index.vue'
	import sweepKs from './sweepKs/index.vue'
	import scanCode from '../scanCode/index.vue'
	export default {
		components: {
			sweep,
			sweepKs,
			scanCode
		},
		data() {
			return {
				sweep: false,
				sweepKs: false,
				scanCode: false,
				id: ''
			}
		},
		onShow: function() {
			// 每次页面显示都重新调用
			this.query()
		},
		// mounted() {
		// 	this.query()
		// },
		methods: {
			query() {
				//获取本地存储信息
				var data = wx.getStorageSync('sweepValue')
				console.log(data)
				if (data == "sweep") {
					this.sweep = true
					this.sweepKs = false
					this.scanCode = false
				} else if (data == "sweepKs") {
					this.sweepKs = true
					this.sweep = false
					this.scanCode = false
				} else if (data == "scanCode") {
					this.scanCode = true
					this.sweepKs = false
					this.sweep = false
				}
			}
		}
	}
</script>

<style>
</style>